Fatal error: Call to a member function getId() on a non-object in /usr/local/apache...
authorReedy <reedy@wikimedia.org>
Sat, 28 Apr 2012 21:39:00 +0000 (22:39 +0100)
committerReedy <reedy@wikimedia.org>
Sat, 28 Apr 2012 21:39:00 +0000 (22:39 +0100)
getNext() can return null!

Change-Id: I76a8e50076165d89c90796c6e925913c64722a3a

includes/EditPage.php

index dce8d91..015099a 100644 (file)
@@ -819,7 +819,7 @@ class EditPage {
 
                                                        # If we just undid one rev, use an autosummary
                                                        $firstrev = $oldrev->getNext();
-                                                       if ( $firstrev->getId() == $undo ) {
+                                                       if ( $firstrev && $firstrev->getId() == $undo ) {
                                                                $undoSummary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() );
                                                                if ( $this->summary === '' ) {
                                                                        $this->summary = $undoSummary;